<script lang="ts" setup>
    import axios from 'axios';
    import { ref } from 'vue';
    import { useRouter } from 'vue-router';

    let userData = ref(null)
    let router = useRouter()
    let formData = ref({
      username:"",
    })

    axios.get("http://localhost:8080/api/system",{
      headers:{
        "Authorization": "Bearer " + localStorage.getItem("token")
      }
    }).then((res) => {
        // console.log(res.data)
        userData.value = res.data
    })
</script>

<template>
  <h1>系统管理</h1>
  <div class="list">
    <el-table :data="userData" style="width: 100%">
        <el-table-column prop="id" label="序号" width="180" />
        <el-table-column prop="username" label="书名" width="180" />

        <el-table-column label="操作">
          <template #default="data">
            <el-button type="primary" @click="">详情</el-button>
            <el-button type="primary" @click="">编辑</el-button>
            <el-button type="danger" @click="">删除</el-button>
          </template>
        </el-table-column>
    </el-table>
    <el-button type="primary" @click="">添加</el-button>
  </div>
    
</template>

<style scoped>

</style>